package com.gdqy.FCS.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gdqy.FCS.dao.ClothingTypeDao;
import com.gdqy.FCS.entity.ClothingType;

@Service
@Transactional
public class ClothingTypeService {
	
	@Autowired 
	private ClothingTypeDao clothingTypeDao;
	
		//新增分类
		public int insert(ClothingType clothingType){
			return clothingTypeDao.insert(clothingType);
		}
		//获取分类
		public List<ClothingType> selectClothing_class(String parent_code){
			return clothingTypeDao.selectClothing_class(parent_code);
		}
		//通过name获取服装类型
		public ClothingType selectByName(String name){
			return clothingTypeDao.selectByName(name);
		}
		//通过code查询
		public ClothingType selectByCode(String code){
			return clothingTypeDao.selectByCode(code);
		}
		//通过parent_code和name查询
		public ClothingType selectByParent_codeAndName(String parent_code,String name){
			return clothingTypeDao.selectByParent_codeAndName(parent_code, name);
		}
		//通过id查询
		public ClothingType selectById(int clothingType_id){
			return clothingTypeDao.selectById(clothingType_id);
		}
		//通过id删除
		public int deleteById(int clothingType_id){
			return clothingTypeDao.deleteById(clothingType_id);
		}
		
		public List<ClothingType> selectAll(){
			return clothingTypeDao.selectAll();
		}
		
}
